<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/'}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>数据导出</title>
    <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
    <!-- Reset Stylesheet -->
    <link rel="stylesheet" href="resources/css/reset.css" type="text/css"
          media="screen" />
    <!-- Main Stylesheet -->
    <link rel="stylesheet" href="resources/css/style.css" type="text/css"
          media="screen" />
    <link rel="stylesheet" href="resources/css/invalid.css" type="text/css"
          media="screen" />

    <!--                       Javascripts                       -->
    <!-- jQuery -->
    <script type="text/javascript"
            src="resources/scripts/jquery-1.8.3.min.js"></script>
    <!-- jQuery Configuration -->
    <script type="text/javascript"
            src="resources/scripts/simpla.jquery.configuration.js"></script>
    <script>
        function myexport() {
            var che = "one";
            var hids = [];
            var groupCheckbox= $("input[name= checkbox]:checked");
            groupCheckbox.each(function(){
                var row = $(this).parent("td").parent("tr");   //获取当前行

                var hid = row.find("[name = 'hid']").html();

                hids.push(hid);
            });
            alert(hids);
            document.getElementById("export").href="/system/export/exp?hids="+hids+"&checked="+che;
        }
        function myexportAll() {
            var che = "All";
            var hids = [];
            var groupCheckbox= $("input[name= checkbox]");
            groupCheckbox.each(function(){

                var row = $(this).parent("td").parent("tr");   //获取当前行

                var hid = row.find("[name = 'hid']").html();

                hids.push(hid);
            });
            alert(hids);
            document.getElementById("exportAll").href="/system/export/exp?hids="+hids+"&checked="+che;
        }
    </script>
</head>
<body>
<div id="main-content">
    <div class="content-box">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <table>
                    <thead>
                    <tr>
                        <th><input class="check-all" type="checkbox" id="checkAll" name="checkAll"/></th>
                        <th>酒店编号</th>
                        <th>酒店标题</th>
                        <th>酒店图片</th>
                        <th>酒店类型</th>
                        <th>所属城市</th>
                        <th>行政区域</th>
                        <th>酒店星级</th>
                        <th>酒店品牌</th>
                        <th>开业时间</th>
                        <th>酒店描述</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each=" hotal : ${hotalList} ">
                        <td><input type="checkbox" id="checkbox" name="checkbox"/></td>
                        <th th:text="${hotal.id}" name="hid">酒店编号</th>
                        <th th:text="${hotal.hotalName}" name="hotalName">酒店标题</th>
                        <th><img style="width: 150px; height:130px" th:src="|/system/res/getImage?path=${hotal.hotalImage}|"></th>
                        <th th:text="${hotal.type}" name="hotalType">酒店类型</th>
                        <th th:text="${hotal.cid}" name="city">所属城市</th>
                        <th th:text="${hotal.regid}" name="regid">行政区域</th>
                        <th th:text="${hotal.star}" name="star">酒店星级</th>
                        <th th:text="${hotal.brand}" name="brand">酒店品牌</th>
                        <th th:text="${#dates.format(hotal.openTime,'yyyy-MM-dd')}" name="openTime">开业时间</th>
                        <th th:text="${hotal.hotalInfo}" name="hotalInfo">酒店描述</th>
                    </tr>
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="2">
                            <div class="bulk-actions align-left">
                                <a id="export" class="mybutton" type="button" onclick="myexport();" href="">导出</a>
                            </div>
                        </td>
                        <td colspan="2">
                            <div class="bulk-actions align-left">
                                <a id="exportAll" class="mybutton" type="button" onclick="myexportAll();" href="">全部导出</a>
                            </div>
                        </td>
                        <td colspan="7">
                            <div class="pagination">
                                <a href="#" title="First Page">&laquo; First</a>
                                <a href="#" title="Previous Page">&laquo; Previous</a>
                                <a href="#" class="number" title="1">1</a>
                                <a href="#" title="Next Page">Next &raquo;</a>
                                <a href="#" title="Last Page">Last &raquo;</a>
                            </div>
                            <div class="clear"></div>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </div>
        <!-- End .content-box-content -->
    </div>
</div>
<!-- End #main-content -->
</body>
</html>